﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GnufBase.h"
#include "GnufBaseUtils.h"

namespace gnuf {
    class GNUF_BASE_EXPORT Info final : public gcmp::WeakReferenceable
    {
    public:
        explicit Info();
        explicit Info(const Info *);
        explicit Info(const Info &);
        explicit Info(const std::wstring & caption);
        explicit Info(const std::wstring & caption, const std::wstring & tooltip);
        explicit Info(const std::wstring & caption, const Tooltip &);
        explicit Info(const std::wstring & caption, const std::wstring & tooltip, const std::wstring & iconDir);
        explicit Info(const std::wstring & caption, const Tooltip &, const std::wstring & iconDir);
        ~Info();

        // Caption.
        const std::wstring & caption() const { return m_caption; }
        void setCaption(const std::wstring & val) { m_caption = val; }

        // ToolTip.
        const Tooltip & tooltip() const { return m_tooltip; }
        Tooltip & rTooltip() { return m_tooltip; }
        void setTooltip(const std::wstring & val) { m_tooltip.setCaption(val); }
        void setTooltip(const Tooltip & val) { m_tooltip = val; }

        // Icon.
        const Icon & icon() const { return m_icon; }
        const std::wstring & iconDir() const { return m_icon.dir(); }
        void setIconDir(const std::wstring & val) { m_icon.setDir(val); }

        // operate
        bool operator==(const Info & that) const;
        Info & operator=(const Info & that);

    private:
        std::wstring m_caption;
        Tooltip m_tooltip;
        gnuf::Icon m_icon;
    };
}
